package com.qingke;
//time=2"56'
public class ChallengeDay2 {
	public static void main(String[] args){
		int[][] a=new int[5][5];
		int num=1;
		for(int i=0;i<5;i++){
			for(int j=0;j<5;j++){
				a[i][j]=num;
				num++;
				if(a[i][j]<10){
					System.out.print(" ");
				}
				System.out.print(a[i][j]+" ");
			}
			System.out.println("");
		}
		for(int i=0;i<5;i++){
			for(int j=0;j<i;j++){
				a[i][j]=a[i][j]+a[j][i];
				a[j][i]=a[i][j]-a[j][i];
				a[i][j]=a[i][j]-a[j][i];
			}
		}
		
		System.out.println("");
		System.out.println("");
		for(int i=0;i<5;i++){
			for(int j=0;j<5;j++){
				if(a[i][j]<10){
					System.out.print(" ");
				}
				System.out.print(a[i][j]+" ");
			}
			System.out.println("");
		}
	}

}
